package spring.lottery.server.enums;

import lombok.Getter;

@Getter
public enum ActivityStatusEnum {
    RUNNING(1, "活动正在进行"),
    PRIZE_RUNNING(2, "奖品未抽取"),
    USER_RUNNING(3, "人员未中奖"),

    COMPLETED(4, "活动已结束"),
    PRIZE_COMPLETED(5, "奖品活动已结束"),
    USER_COMPLETED(6, "人员已中奖"),
    ;

    private int code;
    private String desc;

    private ActivityStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public ActivityStatusEnum forName(String desc) {
        for (ActivityStatusEnum activityStatusEnum : ActivityStatusEnum.values()) {
            if (activityStatusEnum.desc.equals(desc)) {
                return activityStatusEnum;
            }
        }
        return null;
    }

}
